package com.baizhi.jishi.controller;

import com.baizhi.jishi.entity.Triage;
import com.baizhi.jishi.service.TriageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;
import java.util.Map;

@Controller
@RequestMapping("/triage")
public class TriageController {
    @Autowired
    private TriageService triageService;
    @RequestMapping("/add")
    @ResponseBody
    public Map add(Triage triage, HttpSession session){
        return triageService.add(triage,session);
    }
    @RequestMapping("/showPage")
    @ResponseBody
    public Map showPage(int page,int limit,int id){
        return triageService.showPage(page,limit,id);
    }
    @RequestMapping("/selectOne")
    @ResponseBody
    public Map selectOne(int id){
        return triageService.selectOne(id);
    }
    @RequestMapping("/update")
    @ResponseBody
    public Map update(Triage triage){
        return triageService.update(triage);
    }
}
